require "premake/core"

workspace "kjni"
	configurations { "Debug", "Release" }
	location "build"
	flags{"C++11"}
	
if is_pfm("android") then
	location "android/jni"
	defines { "POSIX" ,"ANDROID_NDK" }
elseif is_pfm("windows") then
	location "win32"
	defines { "_WIN32", "WIN32" , "NOMINMAX"}
	disablewarnings {
		"4819",
		"4996"
	}
elseif is_pfm("ios") then
	location "ios"
	defines { "POSIX" ,"TARGET_OS_IOS"}

	xcodebuildsettings{
		["SDKROOT"] = "iphoneos",
		["TARGETED_DEVICE_FAMILY"] = "1,2",
		["ALWAYS_SEARCH_USER_PATHS"] = "YES",
		["CLANG_CXX_LANGUAGE_STANDARD"] = "gnu++0x",
		["CLANG_CXX_LIBRARY"]= "libc++",
		["CLANG_ENABLE_OBJC_ARC"] = "YES",
		["IPHONEOS_DEPLOYMENT_TARGET"] = "10.2",
	}
	iosfamily = "iPhone/iPod touch"
	if not symbols then
		symbols=function()
		end
	end
end

filter "configurations:Debug"
	defines { "DEBUG" , "_DEBUG"}
	symbols "On"
	optimize "Debug"
	
filter "configurations:Release"
	defines { "NDEBUG" }
	symbols "Off"
	optimize "Speed"


project "test_jni"
	kind "SharedLib"
	language "C++"
	files{
		"jni/*.h",
		"jni/*.cpp",
		"*.h",
		"*.cpp",
	}

	links{
		"log",
	}


